package de.tud.binpacking.heuristic;

import java.util.LinkedList;
import java.util.List;

import de.tud.binpacking.heuristic.construction.AStartHeuristic;
import de.tud.binpacking.heuristic.improvement.AImprovementHeuristic;
import de.tud.binpacking.instance.Instance;

public class Workflow implements Runnable {

	protected AStartHeuristic startHeuristic;
	protected List<AImprovementHeuristic> heuristics = new LinkedList<AImprovementHeuristic>();
	
	public Workflow(Instance instance, AStartHeuristic startHeuristic) {
		
		if (startHeuristic == null) {
			throw new NullPointerException("Construction heuristic cannot be null");
		}
		
		this.startHeuristic = startHeuristic;
	}
	
	@Override
	public void run() {
		
		startHeuristic.run();
		
		for (AImprovementHeuristic heuristic : heuristics) {
//			heuristic.run(); //TODO
		}
		
	}
	
	public boolean addImprovementHeuristic(AImprovementHeuristic heuristic) {
		return heuristics.add(heuristic);
	}
	
}
